/*
 * -------------------------------------------------------------------------
 * synchronization.h -- 
 * Speech Watermarking
 * Copyright (C) 2011-2012  Oriol Parera Fiestas
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * -------------------------------------------------------------------------
 */


#ifndef SYNCHRONIZATION_H
#define SYNCHRONIZATION_H

#include <stdio.h>
#include "arq.h"
#include "types.h"
#include "parameters.h"
#if ARQ_x86
	#include <math.h>
#endif


/**
* @brief hides the synchronization mark
*
* @param Memory address to the samples where to hide the mark
*/
void putSynMark (sample_t samples);

/**
* @brief tests wether the synchronization mark exists or not
*
* @param Memory address to the samples where to test
*
* @return 0 if the mark has been found
*         -1 otherwise
*/
int testSynMark (const sample_t samples);

/**
* @brief hides a bit of the synchronization mark
*
* @param Memory address to the samples where to hide the bit
* @param Bit to hide
*/
void insertBit (sample_t samples, const unsigned bit);

/**
* @brief 
*
* @param Memory address to the samples where to get the bit
*
* @return The extracted bit.
*/
unsigned getBit (const sample_t samples);

#endif /*  SYNCHRONIZATION_H */
